<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <script type="text/javascript" src="js/jquery-1.2.6.js"></script>
    <link type="text/css" rel="stylesheet" href="style/login.css"/>
    <script type="text/javascript" src="plugin/artDialog.js?skin=green"></script>
    <script type="text/javascript" src="js/english.js"></script>
   <!-- <script type="text/javascript">
        if(getCookie("Language")){
        document.write('<script type="text/javascript" src="js/'+getCookie("Language")+'.js"><\/script>');
        }else{
            document.write('<script type="text/javascript" src="js/english.js"><\/script>');
        }
    </script>-->

    <title>WROC</title>
</head>
<body class="main_login">
        <div class="login" id="login">
            <p class="one"></p>

            <p class="two"></p>

            <p class="three"></p>

            <div id="login_top">
                <table width="452px" height="247px" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="2"> &nbsp;
         <!--           <span style="margin-right: 8px;float:right;" id="changeLanguage">
                    <a style="float: right;"><img src="images/english.png" alt="" style="cursor:pointer" id="chooseEn"/></a>
                    <a style="float: right;"><img src="images/chinese.png" alt="" style="cursor:pointer" id="chooseCh"/></a>
                     </span>-->
                        </td>
                    </tr>
                    <tr>
                        <td id="td_logo" style=""><img src="images/login_logo.png" ></td>
                        <td><span style="margin-right:120px;font-size: 30px;" id="position"><img src="images_en/product.png" id="product_image"></span></td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td id="td_user"><label sid="login.username"></label></td>
                        <td align="left"><input name="username" maxlength="15"  id="name"
                                                class="login_text"/></td>
                    </tr>
                    <tr>
                        <td id="td_password"><label sid="login.password"></label></td>
                        <td align="left"><input type="password" name="password" maxlength="15"
                                                class="login_text"/></td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                </table>
            </div>
            <div id="login_bottom">
                <table width="100%" height="103px" border="0" cellpadding="0" cellspacing="0">
                    <tr width="100%" height="100%">
                        <td id="bottom_left" height="103px" width="5px">&#160;</td>
                        <td id="div_bottom" height="103px" width="442px">
                            <a onclick="loginWeb();">
                                <img src="images_en/login_button.png" border="0" id="login_button">
                            </a><br/><br/><br/><br/>
                        </td>
                        <td id="bottom_right" height="103px" width="5px">&#160;</td>
                    </tr>
                </table>
            </div>
            <input type="submit" class="button" style="display:none;">
        </div>

        <div id="rightMenu" style="display: none">
            <ul>
                <li id="editWords">Edit</li>
                <li id="defaultValue">Default</li>
            </ul>
        </div>
<script type="text/javascript">
     var languageType ='english';
     setCookie("Language", "english");
     var langauaCookie =getCookie("Language");
        $("#position").css({"margin-right":50});
    $(document).ready(function () {
        document.onkeypress = function () {
            var iKeyCode = -1;
            if (arguments[0]) {
                iKeyCode = arguments[0].which;
            }
            else {
                iKeyCode = event.keyCode;
            }
            if (iKeyCode == 13) {
                loginWeb();
            }
        }
        $("label").each(function () {
            var currentVal =$(this);
            $(this).html(decodeURIComponent(eval($(this).attr("sid"))));
            $(this).rightClick(function(){
                if(currentVal.attr("sid")) {
                    showEditDialog(currentVal);
                    currentVal.addClass("EditPosition");
                }else{
                    document.getElementById("rightMenu").style.display = "none";
                }
            })
        });
        if(langauaCookie=="english" ||languageType==="english"){
            languageType="english";
            $("#login_button").attr("src","images_en/login_button.png");
            document.title="WROC";
            $("#td_logo").find("img").attr("src","images/login_logo.png");
            $("#product_image").attr("src","images_en/product.png");
        }
        $("[type='button']").each(function () {
            $(this).val(eval($(this).attr("sid")));
        });
        $("#changeLanguage").click(function (e) {
            var $target = $(e.target);
            if ($target.attr("id") == "chooseEn") {
                languageType ="english";
                setCookie("Language", "english");

            } else {
                languageType ="chinese";
                setCookie("Language", "chinese");

            }
            if(window.ActiveXObject){
			 var wsh = new ActiveXObject("Custom.jsdll");
            if (wsh!=null)
            {
                var path = window.location.pathname;
                path =path.substr(1,path.length);
                wsh.setpath(path);
                wsh.changelan("jsfile",getCookie("Language")+".js");

               var sret=wsh.getresult;
               if(sret!="yes"){
                   alert(sret);
                   }
		      }else{
			      alert("创建 ActiveX 时出错！");
			  }
            }else{
                alert(msg.softValid);
            }
             
             window.location.href ='login.htm';
        });

        var top = document.body.scrollHeight / 2 - 30;
        $("#login").css({
             "margin-top":getHeight()/3-30
         });


         $("#login_button").bind("mouseover",function(){
              var arr= $(this).attr("src").split("/");
              $(this).attr("src",arr[0]+"/login_button_hover.png");
         });
        $("#login_button").bind("mouseout",function(){
            var arr= $(this).attr("src").split("/");
            $(this).attr("src",arr[0]+"/login_button.png");
        });


    });
    function loginWeb(){
             window.location.href = "menuGuide.htm?type=nofirst&language=english";
    }
        function getHeight(){

            var yScroll;

            if (window.innerHeight && window.scrollMaxY) {
                yScroll = window.innerHeight + window.scrollMaxY;
            } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                yScroll = document.body.scrollHeight;
            } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                yScroll = document.body.offsetHeight;
            }

            var windowHeight;
            if (self.innerHeight) { // all except Explorer
                windowHeight = self.innerHeight;
            } else if (document.documentElement && document.documentElement.clientHeight) {
                // Explorer 6 Strict Mode
                windowHeight = document.documentElement.clientHeight;
            } else if (document.body) { // other Explorers
                windowHeight = document.body.clientHeight;
            }

            // for small pages with total height less then height of the viewport
            if(yScroll < windowHeight){
                pageHeight = windowHeight;
            } else {
                pageHeight = yScroll;
            }
            return pageHeight;
        }

</script>
</body>
</html>